Fix the tools build:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 16 May 2006 12:35:59 +0000 (13:35 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 16 May 2006 12:35:59 +0000 (13:35 +0100)
 1. xenctrl.h needs to include stddef.h to define size_t
 2. tbctl is broken -- remove it since xenmon and xentrace
    both automatcially enable tracing now
 3. Fix setsize after xc_tbug interface changes

Signed-off-by: Keir Fraser <keir@xensource.com>
tools/libxc/xenctrl.h
tools/xentrace/Makefile
tools/xentrace/setsize.c

index 7e658c16c690d7a85e7a9990a670dcc9a64d1799..abb0230d5393144806fef6efe59a45b4e18cfcca 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef XENCTRL_H
 #define XENCTRL_H
 
+#include <stddef.h>
 #include <stdint.h>
 #include <sys/ptrace.h>
 #include <xen/xen.h>
index f7f8ac1969b8d62c940fab626756109ccd29704b..0bebd5eea7ef0214fa2b985f928ba92d5a8a2278 100644 (file)
@@ -14,7 +14,7 @@ CFLAGS  += -I $(XEN_LIBXC)
 HDRS     = $(wildcard *.h)
 OBJS     = $(patsubst %.c,%.o,$(wildcard *.c))
 
-BIN      = xentrace tbctl setsize
+BIN      = xentrace setsize
 LIBBIN   = 
 SCRIPTS  = xentrace_format
 MAN1     = $(wildcard *.1)
index e13ea173ee09e96a6281b03b1449170c22389762..fcb1fcb6b0ebfbefc60a452fcf8fc603704d2e25 100644 (file)
@@ -5,33 +5,37 @@
 
 int main(int argc, char * argv[])
 {
-  unsigned int size;
-  int xc_handle = xc_interface_open();
+    unsigned long size;
+    int xc_handle = xc_interface_open();
   
-  if (xc_tbuf_get_size(xc_handle, &size) != 0) {
-    perror("Failure to get tbuf info from Xen. Guess size is 0");
-    printf("This may mean that tracing is not enabled in xen.\n");
-    //    exit(1);
-  }
-  else
-    printf("Current tbuf size: 0x%x\n", size);
-  
-  if (argc < 2)
-    exit(0);
+    if ( xc_tbuf_get_size(xc_handle, &size) != 0 )
+    {
+        perror("Failure to get tbuf info from Xen. Guess size is 0");
+        printf("This may mean that tracing is not enabled in xen.\n");
+    }
+    else
+    {
+        printf("Current tbuf size: 0x%lx\n", size);
+    }
+
+    if (argc < 2)
+        exit(0);
 
-  size = atoi(argv[1]);
+    size = atol(argv[1]);
 
-  if (xc_tbuf_set_size(xc_handle, size) != 0) {
-    perror("set_size Hypercall failure");
-    exit(1);
-  }
-  printf("set_size succeeded.\n");
+    if ( xc_tbuf_set_size(xc_handle, size) != 0 )
+    {
+        perror("set_size Hypercall failure");
+        exit(1);
+    }
+    printf("set_size succeeded.\n");
   
-  if (xc_tbuf_get_size(xc_handle, &size) != 0)
-    perror("Failure to get tbuf info from Xen. Tracing must be enabled first");
-  else
-    printf("New tbuf size: 0x%x\n", size);
+    if (xc_tbuf_get_size(xc_handle, &size) != 0)
+        perror("Failure to get tbuf info from Xen."
+               " Tracing must be enabled first");
+    else
+        printf("New tbuf size: 0x%lx\n", size);
   
-  xc_interface_close(xc_handle);
-  return 0;
+    xc_interface_close(xc_handle);
+    return 0;
 }